package pab.ui;

import java.awt.*;
import java.awt.event.*;
import javax.swing.*;

/**
 * @author rukowen
 */
public class AccountAdd extends JFrame {

	private static final long serialVersionUID = 1L;
	public AccountAdd() {
		initComponents();
	}

	private void btnOkMouseClicked(MouseEvent e) {
		// TODO add your code here
	}

	private void btnCancelMouseClicked(MouseEvent e) {
		// TODO add your code here
	}

	private void initComponents() {
		// JFormDesigner - Component initialization - DO NOT MODIFY  //GEN-BEGIN:initComponents
		label1 = new JLabel();
		label2 = new JLabel();
		label3 = new JLabel();
		label4 = new JLabel();
		label5 = new JLabel();
		txtName = new JTextField();
		txtNumber = new JTextField();
		cboCurrency = new JComboBox();
		txtCurrBalance = new JFormattedTextField();
		cboGroup = new JComboBox();
		btnOk = new JButton();
		btnCancel = new JButton();

		//======== this ========
		setTitle("Add a new account");
		Container contentPane = getContentPane();
		contentPane.setLayout(null);

		//---- label1 ----
		label1.setText("Group");
		contentPane.add(label1);
		label1.setBounds(new Rectangle(new Point(45, 40), label1.getPreferredSize()));

		//---- label2 ----
		label2.setText("Name");
		contentPane.add(label2);
		label2.setBounds(45, 70, label2.getPreferredSize().width, 15);

		//---- label3 ----
		label3.setText("Number");
		contentPane.add(label3);
		label3.setBounds(new Rectangle(new Point(45, 100), label3.getPreferredSize()));

		//---- label4 ----
		label4.setText("Current Balance");
		contentPane.add(label4);
		label4.setBounds(new Rectangle(new Point(40, 135), label4.getPreferredSize()));

		//---- label5 ----
		label5.setText("In");
		contentPane.add(label5);
		label5.setBounds(new Rectangle(new Point(45, 165), label5.getPreferredSize()));
		contentPane.add(txtName);
		txtName.setBounds(140, 65, 200, txtName.getPreferredSize().height);
		contentPane.add(txtNumber);
		txtNumber.setBounds(140, 95, 200, 28);
		contentPane.add(cboCurrency);
		cboCurrency.setBounds(140, 155, 120, cboCurrency.getPreferredSize().height);
		contentPane.add(txtCurrBalance);
		txtCurrBalance.setBounds(140, 125, 200, txtCurrBalance.getPreferredSize().height);
		contentPane.add(cboGroup);
		cboGroup.setBounds(140, 35, 120, cboGroup.getPreferredSize().height);

		//---- btnOk ----
		btnOk.setText("Ok");
		btnOk.addMouseListener(new MouseAdapter() {
			@Override
			public void mouseClicked(MouseEvent e) {
				btnOkMouseClicked(e);
			}
		});
		contentPane.add(btnOk);
		btnOk.setBounds(145, 195, 65, btnOk.getPreferredSize().height);

		//---- btnCancel ----
		btnCancel.setText("Cancel");
		btnCancel.addMouseListener(new MouseAdapter() {
			@Override
			public void mouseClicked(MouseEvent e) {
				btnCancelMouseClicked(e);
			}
		});
		contentPane.add(btnCancel);
		btnCancel.setBounds(new Rectangle(new Point(225, 195), btnCancel.getPreferredSize()));

		{ // compute preferred size
			Dimension preferredSize = new Dimension();
			for(int i = 0; i < contentPane.getComponentCount(); i++) {
				Rectangle bounds = contentPane.getComponent(i).getBounds();
				preferredSize.width = Math.max(bounds.x + bounds.width, preferredSize.width);
				preferredSize.height = Math.max(bounds.y + bounds.height, preferredSize.height);
			}
			Insets insets = contentPane.getInsets();
			preferredSize.width += insets.right;
			preferredSize.height += insets.bottom;
			contentPane.setMinimumSize(preferredSize);
			contentPane.setPreferredSize(preferredSize);
		}
		setSize(390, 280);
		setLocationRelativeTo(getOwner());
		// JFormDesigner - End of component initialization  //GEN-END:initComponents
	}

	// JFormDesigner - Variables declaration - DO NOT MODIFY  //GEN-BEGIN:variables
	private JLabel label1;
	private JLabel label2;
	private JLabel label3;
	private JLabel label4;
	private JLabel label5;
	private JTextField txtName;
	private JTextField txtNumber;
	private JComboBox cboCurrency;
	private JFormattedTextField txtCurrBalance;
	private JComboBox cboGroup;
	private JButton btnOk;
	private JButton btnCancel;
	// JFormDesigner - End of variables declaration  //GEN-END:variables
}
